From 040d9d22870e980154873e99676385dad43c6a92 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 28 Nov 2007 12:42:17 +0000 Subject: [PATCH] [Mini-OS] Catch NULL dereferences Unmap page 0 (only used early at boot) so as to catch NULL dereferences. Signed-off-by: Samuel Thibault --- extras/mini-os/arch/x86/mm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extras/mini-os/arch/x86/mm.c b/extras/mini-os/arch/x86/mm.c index 8d4a8d42fb..70143b3e1a 100644 --- a/extras/mini-os/arch/x86/mm.c +++ b/extras/mini-os/arch/x86/mm.c @@ -270,6 +270,9 @@ void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn) start_address += PAGE_SIZE; } + if (HYPERVISOR_update_va_mapping(0, (pte_t) {}, UVMF_INVLPG)) + printk("Unable to unmap page 0\n"); + *start_pfn = pt_pfn; } -- 2.30.2